# $Id: PKGBUILD 78338 2012-10-17 14:39:46Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=dkfilter
pkgver=0.11
pkgrel=9
pkgdesc="Domain key filter"
arch=('any')
url="http://jason.long.name/dkfilter/"
license=('GPL')
depends=(perl-crypt-openssl-rsa perl-mailtools perl-net-dns perl-net-server perl-mail-domainkeys)
options=('!emptydirs')
backup=(etc/conf.d/dkfilter)
install=dkfilter.install
source=(http://jason.long.name/dkfilter/dkfilter-$pkgver.tar.gz
	dkfilter-rc
	dkfilter-in.service
	dkfilter-out.service
	dkfilter.conf.d)
md5sums=('e295678fc728c139137bfadf4a679262'
         'cab0ef8fab0dae6f1b85a6facd1b09ae'
         '550ef7abc5dd6a5610dd6ef7f4ab5fee'
         '4baff6ebf7d8da2b390e1ad49fc041b5'
         'a2fb031fa9493ccc082d953cd023a097')

build() {
  cd  $srcdir/dkfilter-$pkgver
  ./configure --prefix=/usr
  make
  make DESTDIR=$pkgdir install
  install -D -m 0755 $srcdir/dkfilter-rc $pkgdir/etc/rc.d/dkfilter
  install -D -m 0644 $srcdir/dkfilter.conf.d $pkgdir/etc/conf.d/dkfilter

  install -Dm0644 $srcdir/$pkgname-in.service $pkgdir/usr/lib/systemd/system/$pkgname-in.service
  install -Dm0644 $srcdir/$pkgname-out.service $pkgdir/usr/lib/systemd/system/$pkgname-out.service
}
